#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <signal.h>

int main(int argc, char* argv[])
{
    int pid = atoi(argv[1]);
    int sig = atoi(argv[2]);
    int num = atoi(argv[3]);
    union sigval sv = {0};
    int i = 0;
    
    printf("current pid(%d) ...\n", getpid());
    printf("send sig(%d) to process(%d)...\n", sig, pid);
    
    for (i = 0; i < num; i++) {
        sv.sival_int = i;
        sigqueue(pid, sig, sv);
    }

    return 0;
}
